﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo_Console
{
	class Program
	{
		static void Main(string[] args)
		{
			// ***
			// *** Initialize a new default Time instance.
			// ***
			Time t0 = Time.Empty;
			Console.WriteLine("t0 = {0}", t0);

			// ***
			// *** Initialize a time using a standard string format
			// *** (anything that is parseable by DateTime)
			// ***
			Time t1 = "11:35 AM";
			Console.WriteLine("t1 = {0}", t1.ToString("t"));

			// ***
			// *** Initialize a time using a standard string format
			// *** (anything that is parseable by TimeSpan)
			// ***
			Time t2 = "14:05";
			Console.WriteLine("t2 = {0}", t2);

			// ***
			// *** Get the Time from a DateTime instance
			// ***
			Time t3 = DateTime.Now;
			Console.WriteLine("t3 = {0}", t3);

			// ***
			// *** Get a DateTime for yesterday using the specified time.
			// ***
			DateTime yesterday = DateTime.Now.Subtract(TimeSpan.FromDays(1)).Date + t1;
			Console.WriteLine("yesterday = {0}", yesterday);
		}
	}
}
